package servlet;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class ServletConfig
 */
public class ServletConfig extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private javax.servlet.ServletConfig config;


	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/*		Enumeration enumeration=config.getInitParameterNames();
		while(enumeration.hasMoreElements()){
			String name = (String) enumeration.nextElement();
		   String 	value=config.getInitParameter(name)+"<br/>";
			response.getOutputStream().write(value.getBytes());
		}
		String charset=this.config.getInitParameter("charset");*/
		
		this.config= this.getServletConfig();
		System.out.println(config.getInitParameter("name"));
		
	}


	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}


	/*@Override
	public void init(javax.servlet.ServletConfig config) throws ServletException {
		this.config=config;
	}
*/

}
